<?php
    include_once 'class.verifyEmail.php';

    define('LOG_FILE', 'contacts.log');

    $contacts = file("contacts.txt");

    $vmail = new verifyEmail();

    $from = $argv[1];
    $to = $argv[2];

    for ($from; $from <= $to; $from++) {
        if(count($contacts) == $from) break;

        $contact = explode(";", $contacts[$from]);
        $id = trim($contact[0]);
        $email = trim($contact[1]);
        $code = $vmail->check($email);
        error_log($id . "," . $code . "," . $email . "\r\n", 3, LOG_FILE);
        echo $id . "," . $code . "," . $email . "\r\n";
    }
